package tijava.enumerate;

import junit.framework.Assert;

import org.junit.Test;

public class TestTypeInCludeEnumField {
	@Test
	public void testEnumHashCode() {
		CurrencyType ct = CurrencyType.AFA;
		Assert.assertEquals(ct.hashCode(), CurrencyType.AFA.hashCode());
	}

	@Test
	public void testTypeInCludeEnumFieldEquals() {
		TypeInCludeEnumField t1 = new TypeInCludeEnumField(Country.CHN,
				CurrencyType.AFA);
		TypeInCludeEnumField t2 = new TypeInCludeEnumField(Country.CHN,
				CurrencyType.AFA);
		Assert.assertEquals(t1, t2);
	}

	@Test
	public void testTypeInCludeEnumFieldEquals2() {
		TypeInCludeEnumField t1 = new TypeInCludeEnumField(null, null);
		TypeInCludeEnumField t2 = new TypeInCludeEnumField(null, null);
		Assert.assertEquals(t1, t2);
	}

	@Test
	public void testTypeInCludeEnumFieldEquals3() {
		TypeInCludeEnumField t1 = new TypeInCludeEnumField(null, null);
		Assert.assertEquals(t1, t1);
	}

	@Test
	public void testTypeInCludeEnumFieldNotEquals() {
		TypeInCludeEnumField t1 = new TypeInCludeEnumField(Country.CHN, null);
		TypeInCludeEnumField t2 = new TypeInCludeEnumField(null,
				CurrencyType.AFA);
		Assert.assertFalse(t1.equals(t2));
	}

	@Test
	public void testTypeInCludeEnumFieldNotEquals2() {
		TypeInCludeEnumField t1 = new TypeInCludeEnumField(Country.CHN, null);
		Assert.assertFalse(t1.equals(null));
	}
}